cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
project(recipe-12-02 LANGUAGES CXX)

add_executable(hello-world helloWorld.cpp)

if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
    target_compile_definitions(hello-world PUBLIC "IS_LINUX")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
    target_compile_definitions(hello-world PUBLIC "IS_WINDOWS")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
    target_compile_definitions(hello-world PUBLIC "IS_MACOS")
elseif(CMAKE_SYSTEM_NAME STREQUAL "AIX")
    target_compile_definitions(hello-world PUBLIC "IS_AIX")
else()
    target_compile_definitions(hello-world PUBLIC "IS_UNKNOWN")
endif()